package com.clementheliou.cheliou.dal.model.country;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.clementheliou.cheliou.dal.model.base.BaseEntity;

/**
 * Entity dedicated to the countries.
 * 
 * @author Clément HELIOU (clement.heliou@gmail.com)
 * @see {@link BaseEntity};
 * @see {@link Entity};
 * @see {@link Serializable};
 * @see {@link Table}.
 * @since 1.0
 */
@Entity
@Table(name = "country")
public class Country extends BaseEntity implements Serializable {

	/**
	 * UID for serialization.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	private static final long serialVersionUID = 1208057770628691514L;

	/**
	 * The key to be used to translate the country's label.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	private String labelKey;

	/*
	 * Getters & setters.
	 */

	@GeneratedValue(generator = "seq_country")
	@Id
	@SequenceGenerator(name = "seq_country", sequenceName = "seq_country")
	public Integer getId() {
		return id;
	}

	@Basic(optional = false)
	@Column(length = 255, nullable = false)
	@NotNull
	@Size(max = 255)
	public String getLabelKey() {
		return labelKey;
	}

	public void setLabelKey(String labelKey) {
		this.labelKey = labelKey;
	}
}
